#pragma once

#include <string>
#include <map>
#include <list>
#include <algorithm>
#include <mutex>
#include "bondlib.h"

typedef struct _tag_QBPROVICEINFO{
	char Area_Code[16+1];			//区域代码
	char Area_Name[64 + 1];			//区域中文名称
	char Area_English_Name[64+1];	//区域英文文名称
	char Area_Level[16 + 1];
	char Area_Upper_Grade_Code[16 + 1];
}QBPROVINCEINFO;

class S_BONDLIB_EXPORT CQBProvinceInfo
{
public:
	static CQBProvinceInfo& instance();
public:
	std::map<std::string, QBPROVINCEINFO>& GetAllProviceInfo(){return m_map;}

	const QBPROVINCEINFO* GetProviceInfo(const std::string &id);

	bool	Add( QBPROVINCEINFO & info );
	bool	Clear( );
public:
	void DumpStatus(int mode = 0)const;
private:
	CQBProvinceInfo();
	virtual ~CQBProvinceInfo();
protected:
	std::map<std::string, QBPROVINCEINFO> m_map;
	std::mutex			m_mutex;
};
